
#hardware platform: FireBeetle-ESP8266

from machine import ADC
from machine import Pin
import time

adc0=ADC(0)                     #create ADC object on ADC pin
led=Pin(12,Pin.OUT)
while True:
  ad=adc0.read()
  print("adc0=",ad)    #read value, 0-1024
  if ad>200:
    led.value(1)
  else:
    led.value(0)
      
  time.sleep(0.3)
